<?php
require dirname ( __FILE__ ) . '/lib/init.php';

$oid = intval($_GET["oid"]);
$editobj = get_jd_obj($oid);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title></title>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/jquery.form.js"></script>
	<script type="text/javascript" src="js/jquery.validate.js"></script>
	<script type="text/javascript" src="js/jquery.validate.methods.js"></script>
	<script type="text/javascript" src="js/lang/zh-cn.js"></script>
	<script type="text/javascript" src="js/datepicker.js"></script>
    <link rel="stylesheet" type="text/css" href="css/datepicker.css" />
	<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
	<link rel="stylesheet" type="text/css" href="css/base.css" />
	<script type="text/javascript">
	
		$(function(){

			$("#contentform").validate({
				rules: {
			       jobname:"required"
				},
				messages: {
                   jobname:" 请填写职位名称!"
				},
				submitHandler: function(form) {
					CKEDITOR.instances["requirement"].updateElement();
					$("#contentSubmit").attr({'disabled':'disabled'});
					$("#contentform").ajaxSubmit({
						success:function(data){
							parent.parent.maincenter.location = 'jd_list.php';
							parent.parent.show_alert(data);
							parent.parent.close_dialog("JDEDIT");
                            parent.parent.maincenter.location.reload();
						}
					});
					return false;
				}
			});
		});
	</script>
</head>
<body>
<div id="content_form">
	<form id="contentform" name="contentform" action="action/jdAction.php" method="post">
		<table width="750" border="0" cellpadding="0" cellspacing="0" align="left">
			<tr>
				<td height="35" colspan="2" style="padding-left:34px">
					<span><strong>注:</strong>带<span class="warninfo">*</span>的为必填项目!</span>
                    <input type="hidden" name="oid" value="<?php echo $oid;?>" id="oid"/>
					<input type="hidden" name="useraction" value="JDEDIT" id="useraction"/>
				</td>
			</tr>
			<tr><td height="25" colspan="2" style="padding-left:34px"><div id="state_div"></div></td></tr>
            <tr>
                <td width="100" align="right" valign="middle" height="35"><span class="warninfo">*</span>&nbsp;职位:</td>
                <td class="pleft" align="left" valign="middle"><input type="text" name="jobname" id="jobname" value="<?php echo $editobj["jobname"];?>" class="inputtext"/></td>
            </tr>
            <tr>
                <td width="100" align="right" valign="middle" height="35"><span class="warninfo"></span>&nbsp;部门:</td>
                <td class="pleft" align="left" valign="middle"><input type="text" name="department" id="department" value="<?php echo $editobj["department"];?>" class="inputtext"/></td>
            </tr>
            <tr>
                <td width="100" align="right" valign="middle" height="35"><span class="warninfo"></span>&nbsp;公司:</td>
                <td class="pleft" align="left" valign="middle"><input type="text" name="company" id="company" value="<?php echo $editobj["company"];?>" class="inputtext"/></td>
            </tr>
            <tr>
                <td width="100" align="right" valign="middle" height="35"><span class="warninfo"></span>&nbsp;性别:</td>
                <td class="pleft" align="left" valign="middle"><input type="text" name="sex" id="sex" value="<?php echo $editobj["sex"];?>" class="inputtext"/></td>
            </tr>
            <tr>
                <td width="100" align="right" valign="middle" height="35"><span class="warninfo"></span>&nbsp;需求人数:</td>
                <td class="pleft" align="left" valign="middle"><input type="text" name="require_num" id="require_num" value="<?php echo $editobj["require_num"];?>" class="inputtext"/></td>
            </tr>
			<tr>
				<td width="100" align="right" valign="middle" height="35"><span class="warninfo"></span>&nbsp;截止日期:</td>
                <td class="pleft" align="left" valign="middle"><input type="text" name="deadline" id="deadline" value="<?php echo $editobj["deadline"];?>" class="dateformat-Y-ds-m-ds-d no-animation disable-drag" readonly="readonly"/></td>
			</tr>
			<tr>
				<td width="100" align="right" valign="top" height="35" class="ptop" style="padding-top: 7px;"><span class="warninfo"></span>&nbsp;工作要求:</td>
				<td class="pleft" align="left" valign="middle" style="padding-top: 7px;">
					<textarea cols="10" id="requirement" name="requirement" rows="10"><?php echo $editobj["requirement"];?></textarea>
					<script type="text/javascript">
						CKEDITOR.replace("requirement",{height:"220px",width:'500px'});
					</script>
				</td>
			</tr>
			<tr>
				<td height="35">&nbsp;</td>
				<td class="pleft"><input type="submit" name="contentSubmit" id="contentSubmit" value="提交" /></td>
			</tr>
		</table>
	</form>
</div>
</body>
</html>